<template>
	<view class="wrap">
		<view class="audit-header">
			<u-dropdown>
				<u-dropdown-item v-model="value1" title="全部" :options="options1"></u-dropdown-item>
			</u-dropdown>
			<view>排序</view>
		</view>
		<view class="audit-list">
			<view v-for="(item,index) in sheetList" :key="index">
				<work-sheet-item :workSheet="item" :is-last="index === (sheetList.length-1)" @toDetail="toDetail">
				</work-sheet-item>
			</view>
		</view>
		<choose-pop :popShow="chooseVisible" contentHeight="300rpx" :itemList="cateList" @itemClick="onCateClick">
		</choose-pop>
	</view>
</template>

<script>
	import iconText from '@/components/icon-text.vue'
	import choosePop from '@/components/choose-pop.vue'
	import workSheetItem from '@/pages/mine/workSheet/components/work-sheet-item.vue'
	export default {
		components: {
			iconText,
			choosePop,
			workSheetItem
		},
		data() {
			return {
				value1: 1,
				value2: 2,
				options1: [{
						label: '全部',
						value: 1,
					},
					{
						label: '待审核',
						value: 2,
					},
					{
						label: '已审核',
						value: 3,
					}
				],
				sheetList: [{
						orderNum: 21060611,
						state: 1,
						devName: '设备A',
						macAddres: 'AD-23-SV-MB-22',
						faultReason: '接触不良',
						reportMan: '张三',
						reportTime: '2021-06-08 15:23:11',
						repairMan: '李四',
						repairTime: '2021-06-08 16:23:11',
					},
					{
						orderNum: 21060611,
						state: 1,
						devName: '设备A',
						macAddres: 'AD-23-SV-MB-22',
						faultReason: '接触不良',
						reportMan: '张三',
						reportTime: '2021-06-08 15:23:11',
						repairMan: '李四',
						repairTime: '2021-06-08 16:23:11',
					}, {
						orderNum: 21060611,
						state: 1,
						devName: '设备A',
						macAddres: 'AD-23-SV-MB-22',
						faultReason: '接触不良',
						reportMan: '张三',
						reportTime: '2021-06-08 15:23:11',
						repairMan: '李四',
						repairTime: '2021-06-08 16:23:11',
					}, {
						orderNum: 21060611,
						state: 1,
						devName: '设备A',
						macAddres: 'AD-23-SV-MB-22',
						faultReason: '接触不良',
						reportMan: '张三',
						reportTime: '2021-06-08 15:23:11',
						repairMan: '李四',
						repairTime: '2021-06-08 16:23:11',
					}, {
						orderNum: 21060611,
						state: 1,
						devName: '设备A',
						macAddres: 'AD-23-SV-MB-22',
						faultReason: '接触不良',
						reportMan: '张三',
						reportTime: '2021-06-08 15:23:11',
						repairMan: '李四',
						repairTime: '2021-06-08 16:23:11',
					}, {
						orderNum: 21060611,
						state: 1,
						devName: '设备A',
						macAddres: 'AD-23-SV-MB-22',
						faultReason: '接触不良',
						reportMan: '张三',
						reportTime: '2021-06-08 15:23:11',
						repairMan: '李四',
						repairTime: '2021-06-08 16:23:11',
					},
				],
			}
		},
		methods: {
			showCatePop() {
				this.chooseVisible = true
			},
			onCateClick(index) {
				this.chooseVisible = false
				switch (index) {
					case 0:
						this.cateText = '全部';
						break;
					case 1:
						this.cateText = '待审核';
						break;
					case 2:
						this.cateText = '已审核';
						break;
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - env(safe-area-inset-bottom));
		overflow-y: scroll;
		background: #f5f5f5;

		.audit-header {
			display: flex;
			flex-direction: row;
			justify-content:space-between;
			align-items: center;
			background: #ffffff;
			padding:0 30rpx;
		}
		.audit-list{padding:30rpx;}
	}
</style>
